<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            position: relative;
            width: 150px;
            height: 30px;
            border: 1px solid black;
        }
        div::after{
            content: '';
            width: 10px;
            height: 10px;
            position: absolute;
            border-right: 1px solid black;
            border-bottom: 1px solid black;
            right: 7px;
            top: 7px;
            transform: rotate(45deg);
            transition: all 0.2s linear;
        }
        /* 鼠标经过div，里面的三角旋转 */
        div:hover::after{
            top: 14px;

            /* 注意transform这个属性的运动都是相对于元素原始位置的，而不是上一次运动完之后的位置 */
            transform: rotate(225deg);
        }
    </style>
</head>
<body>
    <div>

    </div>
</body>
</html>